package com.smedi.ismedi.personnel.core.domain.repository;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.smedi.ismedi.personnel.core.application.query.vo.PersonDetailVo;
import com.smedi.ismedi.personnel.core.domain.aggregatemodel.Person;
import com.smedi.ismedi.personnel.core.domain.aggregatemodel.model.OrganizationAssignment;
import com.smedi.ismedi.personnel.core.domain.aggregatemodel.model.SimplePerson;
import com.smedi.ismedi.personnel.core.port.adapter.persistence.dto.OrganizationAssignmentQuery;
import com.smedi.ismedi.personnel.core.port.adapter.persistence.dto.PersonQuery;

import java.util.List;

/**
 * @Author: xulinjun
 * @Date: 2021-6-8 10:56
 */
public interface PersonRepository {
    Person selectByPersonId(Long personId,Boolean isDelete);

    List<Person> selectByPersonIds(List<Long> personIds,Boolean isDelete);

    int selectIdCardCount(String idCard, Long personId,Boolean isDelete);

    int selectMobileCount(String mobile, Long personId,Boolean isDelete);

    int selectEmployeeNumCount(String employeeNum, Long personId,Boolean isDelete);

    Person doInsert(Person data);

    Person doUpdate(Person data);

    IPage<Person> selectPersonPaginationByLastNameAndEmployeeNum(Long offset, Long pageSize, String lastName, String employeeNum,Boolean isDelete);

    Person selectByIdCard(String idCard,Boolean isDelete);

    void doDeleteByPersonId(Long personId);

    List<SimplePerson> getSimplePersonList(PersonQuery personQuery);

    SimplePerson getSimplePersonOne(PersonQuery personQuery);
    List<PersonDetailVo> getPersonDetailList(PersonQuery personQuery);

    List<OrganizationAssignment> getOrganizationAssignmentList(OrganizationAssignmentQuery organizationAssignmentQuery);

    List<Person> selectByMobile(String mobile,Boolean isDelete);

    void saveSimplePerson(SimplePerson simplePerson);
}
